let handleTime = {
    base_format(time) {
        let date = new Date(time)
        return date.getFullYear() + '-' + this.fill0((date.getMonth() + 1)) + '-' + this.fill0((date.getDate())) + '-' + this.fill0((date.getHours())) + '-' + this.fill0((date.getMinutes())) + '-' + this.fill0((date.getSeconds()))
    },
    fill0(num) {
        return num < 0 ? '0' + num : num
    },
    distanceTime(time) {
        let lastDate = new Date(time).getTime()
        let currentDate = new Date().getTime()

        let distance = parseInt((currentDate - lastDate) / 1000)

        switch (true) {
            case distance < 60:
                return '刚刚'
                break
            case distance > 60 && distance < 3600:
                return parseInt(distance / 60) + '分钟前'
                break
            case distance > 3600 && distance < 3600 * 24:
                return parseInt(distance / 3600) + '小时前'
                break
            case distance > 3600 * 24 && distance < 3600 * 24 * 30:
                return parseInt(distance / 3600 * 24) + '天前'
                break
            case distance > 3600 * 24 * 30:
                return parseInt(distance / 3600 * 24 * 30) + '个月前'
                break
            default:
                return '几年前'
                break

        }
    }
}